import {defineStore} from "pinia"

const initTipText=''
export default defineStore('loading',{
    state:()=>({
      isLoading:false,
      tipText:'',
    }),
    actions:{
      setLoading(isLoading:boolean,tipText?:string){
        this.isLoading=isLoading
        if(isLoading){
          if(tipText) this.tipText=tipText
          else this.tipText=initTipText
        }
      }
    },
    

})